Installing OPA-JAVA on WINDOWS



Hardware, Operating System and Networking Requirements
	
* LINUX-capable server
* 2G RAM, or higher
* 10 GB free hard disk space
* LINUX Operating System	
* Access to Internet with lease line and broadband connection

Software Prerequisites

Software Components
 
1. Java (tm) 2 SDK, Standard Edition - version 1.4.2 or higher.
Download it at:      http://java.sun.com/j2se/1.4.2/download.html   
Download and/or follow the installation instructions

2. TOMCAT 5 or higher
Download it from: http://jakarta.apache.org/tomcat/index.html

3.MySQL Version 4.1.x  Database Server
Download it at:
http://www.mysql.com  .Download and/or follow the installation instructions.
http://www.mysql.com/doc/en/Linux-RPM.html

4. Web Browser
Mozilla 1.3
Any browser that works on LINUX, eg Firefox

5. Download OPA 
There are usually two zip files: the main application file and the help file. Download both


Important: Install required software in the order shown above, except for Web Browser 
which probably was installed with the Operating System. 

=======================================================================================
OPA-JAVA Installation 
=======================================================================================


1. Unzip the zip file to some temporary folder. 

2.Copy the MySQL driver ("mysql-connector-java-3.0.x-stable-bin.jar") downloaded above
to     <TOMCAT_HOME>/common/lib/
      
* <TOMCAT_HOME> is TOMCAT home folder 
             
If there is difficulty connecting to the OPA database, it may be related to the
version of the driver. Download and try versions until you get the one that works 
for your installation.


3. Copy the archive contents as follows:

=======================================================================================
database\     Folder
=======================================================================================

This folder contains the SQL scripts for creating tables and populating those 
needed for initial startup. To run these scripts

1. Create the OPA-JAVA database

      Start Command Prompt 
      Change directory to the directory <MYSQL HOME>\bin
      Type the command "mysql -u root -p"  and hit Enter. 
      Hit Enter again without entering a password.
      Type "create database opa;"  and hit Enter
      Type "use opa;" and hit Enter
 
a. Run the create_db.sql script 
Enter "source /folder/create_db.sql;"     where /folder/ is the path to 
the location of the SQL scripts.  Hit Enter.  The database tables are created.

NOTE: If your database is not named 'opa', edit the script and substitute the proper name.

b.   In similar fashion run all the scripts in \database\data_inserts folder. 
These scripts insert initial data in the database like languages, phrases, and default values.
      
=============================================================================================
opa\     Folder
==============================================================================================

This folder contains the OPA application files.

Copy "opa" subdirectory and paste as a subdirectory of <JWSDP HOME>\webapps\

The OPA directory now looks like
  \opa\
  \opa\admin\
   \opa\archive\
and so on.

=============================================================================================
Help Files     
==============================================================================================

Unzip the help zip file to some temporary folder.

Copy its content to
  \opa\help\html\ 
where \opa\ is your application folder. 

=============================================================================================
context.xml  file. 
=============================================================================================
This is the context file for OPA Application. It is located in 
<TOMCAT_HOME>\webapps\opa\META-INF folder.Edit  the file using a text editor.

Make changes, as appropriate, to the specifications beween <Context> and </Context>; 
especially your database user name and password, and the database name.
==============================================================================
<Context path="/opa" docBase="opa"
            debug="5" reloadable="true" crossContext="true">

  <Logger className="org.apache.catalina.logger.FileLogger"
             prefix="localhost_opa_log." suffix=".txt"
             timestamp="true"/>
	    
	    
    <Resource name="jdbc/opa" auth="Container" type="javax.sql.DataSource"
					   maxActive="100" maxIdle="30" maxWait="10000"
					   username="username" password="password" driverClassName="com.mysql.jdbc.Driver"
					   factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
					   url="jdbc:mysql://localhost:3306/opa?autoReconnect=true"/> 

					   

     <ResourceLink name="jdbc/opa" global="jdbc/opa" type="javax.sql.DataSource"/>	

</Context>

Save context.xml.


=============================================================================================
web.xml  file. 
=============================================================================================
This is the configuration file for OPA Application. It is located in 

Copy this file to <TOMCAT_HOME>\webapps\opa\WEB-INF  folder.
Edit  the file using a text editor.

Make changes, as appropriate, to the specifications beween <web-app> and </web-app>; 
especially your database resource reference name and context parameter.
name and password, and the database name. The database context parameter and resource reference name ("jdbc/opa") must 
match the resource name in the context.xml file (as defined above)

===================================================================================
<?xml version = "1.0" encoding = "ISO-8859-1"?>
<!-- <!DOCTYPE web-app
          PUBLIC
          "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
          "http://java.sun.com/dtd/web-app_2_3.dtd"> -->
	  

<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4"> 

 
    <context-param>
        <param-name>javax.servlet.jsp.jstl.sql.dataSource</param-name>
        <param-value>jdbc/opa</param-value>
    </context-param>

    <resource-ref>
        <description>mysql database connection</description>
        <res-ref-name>jdbc/opa</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

<jsp-config>
	
<taglib>
	<taglib-uri>http://archer-soft.com/taglibs/cf
	</taglib-uri>

	<taglib-location>/WEB-INF/cf.tld
	</taglib-location>
</taglib>

<taglib>
	<taglib-uri>http://jakarta.apache.org/taglibs/mailer-1.1
	</taglib-uri>

	<taglib-location>/WEB-INF/taglibs-mailer.tld
	</taglib-location>
</taglib>

<taglib>
	<taglib-uri>http://java.sun.com/jstl/core
	</taglib-uri>

	<taglib-location>/WEB-INF/c.tld
	</taglib-location>
</taglib>
<taglib>
	<taglib-uri>http://java.sun.com/jstl/sql</taglib-uri>
	<taglib-location>/WEB-INF/sql.tld</taglib-location>
</taglib>
<taglib>
	<taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>

	<taglib-location>/WEB-INF/fmt.tld</taglib-location>
</taglib>

<taglib>
	<taglib-uri>http://java.sun.com/jstl/xml
	</taglib-uri>

	<taglib-location>/WEB-INF/x.tld
	</taglib-location>
</taglib>

<taglib>
	<taglib-uri>http://java.sun.com/jstl/functions
	</taglib-uri>

	<taglib-location>/WEB-INF/fn.tld
	</taglib-location>
</taglib>

</jsp-config>

</web-app>
============================================================================================
Save web.xml.
===========================================================================================

===========================================================================================

1. Restart your computer.

2. Create Tomcat Startup Script

Edit this command file and substitute the parameters as appropriate
========================================================================================
#!/bin/bash

TOMCAT_USER=<user>
TOMCAT_PATH=<path>  
JAVA_HOME=<java-home>
JRE_HOME=$JAVA_HOME/jre
TOMCAT_HOME=<tomcat-home>
CATALINA_HOME=<catalina-home> # usually same as TOMCAT_HOME
CATALINA_OPTS="-Xms256m -Xmx1g -XX:MaxPermSize=256m"
export TOMCAT_HOME TOMCAT_USER JAVA_HOME JRE_HOME CATALINA_HOME CATALINA_OPTS TOMCAT_PATH

start() {
        echo -n "Starting Tomcat:  "
         $TOMCAT_HOME/bin/startup.sh
        sleep 2
}
stop() {
        echo -n "Stopping Tomcat: "
         $TOMCAT_HOME/bin/shutdown.sh
}


case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        start
        ;;
  *)
        echo $"Usage: tomcat {start|stop|restart}"
        exit
esac

exit 0
==================================================================================

Save the file to /etc/init.d/tomcat
Make it executable: chmod 755 /etc/init.d/tomcat

3. (As root user) Start Tomcat 

      /etc/init.d/tomcat start

4. Start OPA as Administrator/Reviewer

          Start your Web Browser (Internet Explorer, Netscape , ...)
           
           	Enter on the address line:

                http://localhost:8080/opa/admin   (if using localhost)
		http://nnn.nnn.nnn.nnn:8080/opa/admin   (if using IP Address   nnn.nnn.nnn.nnn)
		http://abc.com:8080/opa/admin   (if using Web Address abc.com)

5. Start OPA as Public User

          Start your Web Browser (Internet Exploree, Netscape , ...)
           
           Enter on the address line:

             http://localhost:8080/opa/(if using localhost)
	     http://nnn.nnn.nnn.nnn:8080/opa/(if using IP Address nnn.nnn.nnn.nnn)
	     http://abc.com:8080/opa/(if using Web Address abc.com)
  
          
